#include "pagedattention_binder.h"
namespace atb_speed {
PagedAttentionBinder::PagedAttentionBinder() {}
PagedAttentionBinder::~PagedAttentionBinder() {}
 
void PagedAttentionBinder::ParseParam(const nlohmann::json &paramJson)
{
    contextLens_.clear();
    if (paramJson.contains("contextLens")) {
        for (auto item : paramJson["contextLens"]) {
            contextLens_.push_back(item.get<int32_t>());
        }
    }
    batchRunStatus_.clear();
    if (paramJson.contains("batchRunStatus")) {
        for (auto item : paramJson["batchRunStatus"]) {
            batchRunStatus_.push_back(item.get<int32_t>());
        }
    }
}
 
void PagedAttentionBinder::BindTensor(atb::VariantPack &variantPack)
{
    const uint32_t contextLensTensorId = 4;
    variantPack.inTensors.at(contextLensTensorId).hostData = contextLens_.data();
}
}


